<div class="division">
	<{if $minfo}>
	<div class="section">
		<div class="hid_item goods_info">
			<h4 class="title-bg">
				<{t}>商品必填信息<{/t}>
				<em class="c-red">*</em>
			</h4>
			<{foreach from=$minfo item="product" key=product_id}>
			<div class='goods_items' style="padding:10px">
			<h5 style="border-bottom:1px solid #ccc; padding:3px 0" class="mpro_name"><{t}>填写购买&nbsp;&nbsp;<{/t}><{$product.name}><{if $product.nums}> x <{$product.nums}><{/if }><{t}>&nbsp;&nbsp;时所需信息<{/t}></h5>
				<div class="field section" >
					<div>
					  <table width="100%" cellspacing="0" cellpadding="0" border="0" class="liststyle data">
						  <col class="span-5"></col>
						  <col></col>
						  <tbody>
								 <{foreach key=key from=$product.minfo item="info"}>
								  <{assign var="infokey" value=$info.name}>
								  <tr>
								  <th>
									<em class="c-red">*</em><label for="misc_<{$key}>"><{$info.label}>：</label>
									<input type="hidden" class="meta_label" name="minfo[<{$product_id}>][<{$info.name}>][label]" value="<{$info.label}>">
								  </th>
								  <td>
									<{if $info.type=='select'}>
									<select class="inputstyle x-input meta_val" name="minfo[<{$product_id}>][<{$info.name}>][value]">
									<{foreach from=$info.options item=opt}>
									<option value="<{$opt}>"><{$opt}></option>
									<{/foreach}>
									</select>
									<{elseif $info.type=='text'}>
									<{input class="inputstyle x-input meta_val" type="textarea" rows="3" cols="40" id="misc_{$product_id}" name="minfo[{$product_id}][{$infokey}][value]" vtype="required"}>
									<{else}>
									<{input class="inputstyle meta_val" id="misc_{$product_id}" size="30" name="minfo[{$product_id}][{$infokey}][value]" type='required' }>
									<{/if}>
								  </td>
								  </tr>
								  <{/foreach}> 
						  </tbody>
					  </table>
						 
					  </div>
				</div>
			</div>
			<{/foreach}>
		</div>
		<div class="cart-need-conf-div hid_item goods_info"><input type="button" name="btn_goods_minfo" id="goods_needs_minfo" class="cart-btn" value="<{t}>确认必填信息<{/t}>" /><input type="hidden" class="cart-confirm-btn unfold" vtype="need_confirmed" caution='<{t}>商品必填项没有确认！<{/t}>' /></div>
		<div class='FormWrap hid_item goods_needs_minfo' style="display:none; border:none; padding:16px">
			<div class="link_update">
				<a href="javascript:void(0);" title="meta_info" class="cancel_goods_minfo" id="goods_info"><{t}>修改<{/t}></a>
			</div>
			<div id="meta_info_shown_detail"></div>
		</div>
	</div>
	<script>
		(function(){
			
				$('goods_needs_minfo').addEvent('click', function(els){
						
					
						var meta_info = [], meta_pro_name = [];
						
						if(! button_valiate.is_validate($(els.target)) )return;
						
						$ES('.goods_items').each(function(meta_el, meta_index){
							if (!!$ES('.meta_label', meta_el).length){
								meta_pro_name[meta_index] = {"name":$(meta_el).getElement('.mpro_name').innerHTML};
								
								$ES('.meta_label', meta_el).each(function(lbl_el, lbl_index){
									var _val=$ES('.meta_val', $(lbl_el).getParent('tr'));
									if (!!_val.length){	
										if (!meta_info[meta_index] || meta_info[meta_index] == undefined)
											meta_info[meta_index] = [];
										meta_info[meta_index][lbl_index] = {"name":$(lbl_el).getValue(), 'val':_val.getValue()};
									}									
								});
							}
						});						
						
						var tmpl = '<h5 class="mpro_name" style="border-bottom: 1px solid rgb(204, 204, 204); padding: 3px 0pt;">{name}</h5>';
						var tpl = '<dl><dt>{name}</dt><dd>{val}</dd></dl>';
						var _info_shown_detail = [];
						
						meta_pro_name.each(function(val, index){
							_info_shown_detail.push(tmpl.substitute(val));						
							meta_info[index].each(function(meta_val){
								_info_shown_detail.push(tpl.substitute(meta_val));
							});
							
						});
						
						$('meta_info_shown_detail').innerHTML = _info_shown_detail.join('');
						button_valiate.fold($(els.target), 'fold').removeCaution($(els.target));
						
						Order.isEdit($('goods_needs_minfo'));
						
				});
		})();
	</script>
	<{/if}>

	<div class="section">
		<div class="form-title receiver_addr">
			<h4 class="title-bg">
				<{t}>收货信息确认<{/t}>
				<em class="c-red">*</em>
				<span class="link_update">
					<a href="javascript:void(0);" title="addr_id" id="receiver_info" class="hid_item cancel_receiver_info"<{if !$def_arr_addr}> style="display:none;"<{/if}>><{t}>修改<{/t}></a>
					<a href="javascript:void(0);" title="addr_id" class="receiver_info hid_item" id="cancel_receiver_info" style="display:none;"><{t}>取消修改<{/t}></a>
				</span>
			</h4>			
			<div id="def_addr_info" class="hid_item cancel_receiver_info receiver_addr"<{if !$def_arr_addr}> style="display:none;"<{/if}>><{include file="site/common/reciver_def_addr.html" app=b2c}></div>			
		</div>
		<div class="form-body hid_item receiver_info"<{if $def_arr_addr}> style="display:none;"<{/if}>>
			<{include file="site/common/receiver.html" app=b2c}>
		</div>
		<div class="cart-conf-div hid_item receiver_info"<{if $def_arr_addr}> style="display:none"<{/if}>><input type="button"  class="cart-btn" id="receiver_addr" value="<{t}>确认收货信息<{/t}>" /><input type="hidden" class="cart-confirm-btn<{if !$def_arr_addr}> unfold<{/if}>" vtype="need_confirmed" caution='<{t}>收货地址没有确认！<{/t}>' /></div>
		<script>
		(function(){	
			$E('#receiver_addr').addEvent('click', function(el){
				// modify the default area id
				var def_ship_area=$ES("#checkout-select-area select").getLast().getValue();
				$E('input[name^=purchase[def_area]]').value = def_ship_area;
				if ( !button_valiate.is_validate($(el.target)) ) return;	
					
				var index=$E('.receiver-sel') ? $ES('.receiver-sel li').length :0,other_addr=$E('.receiver-sel .other_addr'),bool;
				
				if(other_addr)bool=other_addr.checked;
				var _extends_args = $E('#order-create input[name^=json_extend_args]') ? $E('#order-create input[name^=json_extend_args]').value : null;
				
				new Request.HTML({
					url:Shop.url.purchase_def_addr,
					update:'def_addr_info',
					method:'post',
					data:$E('#receiver').toQueryString() + '&member_id=' + $E('input[name^=purchase[member_id]]').getValue() + '&radio_index=' + index + '&extends_args=' + _extends_args,
					onComplete:function(ns,els,res,js){	
					
						if (!!$E('input[name^=purchase[member_id]]').value.trim().length){					
							var _ck_is_save = $E('input[name^=delivery[is_save]]');
							if (_ck_is_save&&_ck_is_save.checked&&$('def_radio')){		
								var inject_html = [],tmpl = '<li>{addr}</li>';							
								inject_html.push(tmpl.substitute({"addr":$('def_radio').innerHTML}));
								
								if (!other_addr){
									inject_html.push('<li><label><input type="radio" name="delivery[addr_id]" value="0" class="receiver_radio_addr_id other_addr" /> <{t}>其他收货地址<{/t}></label></li>');
									new Element('ul', {"class":"receiver-sel", "html":inject_html.join('')}).inject($('checkout-recaddr'),'before');
									
									var _first_li_input = $E('.receiver-sel input');
									_first_li_input.checked = true;						
									$('receiver').store('def_recaddr', _first_li_input);
								}else{
									var _li = $ES('.receiver-sel li').getLast();
									if (!!bool&&!$E('input[name^=delivery[is_default]]').checked){
										$('receiver').retrieve('def_recaddr',{}).checked = true;
									}
									if(bool)new Element('li',{'html':$('def_radio').innerHTML}).inject(_li,'before');
									
								}
							}
						}
						
						button_valiate.removeCaution($(el.target));
						if (recsave = $E('.recsave')){recsave.hide();$E('input[name^=delivery[is_save]]').checked = false;}
						$('cancel_receiver_info').fireEvent('click',$('cancel_receiver_info'));
					}
				}).send();	
			});
		})();
		</script>
	</div>

	<div class="section">
		<div class="form-title">
			<h4 class="title-bg">
				<{t}>配送方式确认<{/t}>
				<em class="c-red">*</em>
				<span class="link_update">
					<a href="javascript:void(0);" title="dt_id" id="shipping_info" class="hid_item cancel_shipping_info"<{if !$shipping_method.shipping_id || !$is_shipping_match}> style="display:none"<{/if}>><{t}>修改<{/t}></a>
					<a href="javascript:void(0);" title="dt_id" class="shipping_info hid_item" id="cancel_shipping_info" style="display:none"><{t}>取消修改<{/t}></a>
				</span>
			</h4>
		</div>
		<div class="form-body">
			<div id="shipping">
				<{if $delivery_html}>
				<{$delivery_html}>
				<{else}>
					<div class="notice" >
					<{t}>请先“在收货人信息”中选择“收货地区”<{/t}>
					</div>
				<{/if}>
			</div>
		</div>
	</div>

	<div class="section">
		<div class="form-title">
			<h4 class="title-bg">
				<{t}>支付方式确认<{/t}>
				<em class="c-red">*</em>
				<span class="link_update">
					<a href="javascript:void(0);" title="pay_app_id" id="payment_info" class="hid_item cancel_payment_info"<{if !$arr_def_payment || !$is_def_payment_match}> style="display:none;"<{/if}>><{t}>修改<{/t}></a>
					<a href="javascript:void(0);" title="pay_app_id" class="payment_info hid_item" id="cancel_payment_info" style="display:none" ><{t}>取消修改<{/t}></a>
				</span>
			</h4>
		</div>
		<div class="form-body">
			<div id="_payment_currency" style="margin:0 0 0 45px;">
				<{if count($currencys) > 1}>
					<{t}>货币类型：<{/t}>
					<{input type="select" id="payment-cur" name="payment[currency]" rows=$currencys valueColumn="cur_code" labelColumn="cur_name" value=$current_currency class="inputstyle" required="true"}>
				<{else}>
					<{foreach from=$currencys item="currency_item" key="key" name="currency_item"}>
					<{*$currency_item.cur_name*}>
					<input type="hidden" id="payment-cur" name="payment[currency]" value="<{$currency_item.cur_code}>" class="inputstyle" required="true" />
					<{/foreach}>
				<{/if}>
			</div>
			<div id='payment'>
				<{$payment_html}>
			</div>	  
		</div>
	</div>
  
	<div class="section">
		<div class="form-title">
			<h4 class="title-bg">
				<{t}>订单备注：<{/t}>
				<span class="link_update">
					<a href="javascript:void(0);" title="order_memo" id="memo_info" class="hid_item cancel_memo_info" style="display:none"><{t}>修改<{/t}></a>
					<a href="javascript:void(0);" title="order_memo" class="hid_item" id="cancel_memo_info" style="display:none"><{t}>取消修改<{/t}></a>
				</span>
			</h4>
		</div>
		<div class="form-body hid_item memo_info">
			<{input class="inputstyle" style="margin-left:10px;" name="memo" type="text" value="" style='width:400px'}>
		</div>
	</div>
</div>